<?php

namespace app\models\jasper;

trait JasperApiNetworkAccessTrait
{
    /**
     * @param string $iccid
     * @param integer $nacId
     * @param integer $effectiveDate
     * @param boolean $effectiveDateSpecified
     * @return \stdClass
     * @throws \Exception
     */
    public function EditNetworkAccessConfig($iccid, $nacId, $effectiveDate, $effectiveDateSpecified)
    {
        return $this->call(
            preg_replace('/.*JasperApi(.*?)Trait/', '$1', __TRAIT__),
            __FUNCTION__,
            [
                'iccid' => $iccid,
                'nacId' => $nacId,
                'effectiveDate' => date('c', $effectiveDate),
                'effectiveDateSpecified' => $effectiveDateSpecified,
            ]
        );
    }

    /**
     * @param string[] $iccid
     * @return \stdClass
     * @throws \Exception
     */
    public function GetNetworkAccessConfig($iccid)
    {
        return $this->call(
            preg_replace('/.*JasperApi(.*?)Trait/', '$1', __TRAIT__),
            __FUNCTION__,
            [
                'iccid' => $iccid,
            ]
        );
    }
}
